Skip to content

[ciqlts8_6] RDMA/umad: Reject negative data_len in ib_umad_write#1378

Merged
roxanan1996 merged 1 commit into
ciqlts8_6from
{ciq_kernel_automation}_ciqlts8_6
Jun 25, 2026
Merged

[ciqlts8_6] RDMA/umad: Reject negative data_len in ib_umad_write#1378
roxanan1996 merged 1 commit into
ciqlts8_6from
{ciq_kernel_automation}_ciqlts8_6

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

RDMA/umad: Reject negative data_len in ib_umad_write

jira VULN-178538
cve CVE-2026-23243
commit-author YunJe Shin <yjshin0438@gmail.com>
commit 5551b02fdbfd85a325bb857f3a8f9c9f33397ed2
upstream-diff |
	cast second param `hdr_size(file) + hdr_len` in `check_sub_overflow`
	call to size_t to match the type of the first param `count` to fix
	build issue.

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 22m 12s 23m 6s
aarch64 9m 24s 9m 59s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 108 31 ciqlts8_6 ✅ No regressions
aarch64 67 20 ciqlts8_6 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1441 13 ciqlts8_6 ✅ No regressions
aarch64 1426 13 ciqlts8_6 ✅ No regressions

x86_64 newly passing:

  • cap_bounds (PASS)
  • check_keepcaps01 (PASS)
  • check_keepcaps02 (PASS)
  • check_keepcaps03 (PASS)
  • dio28 (PASS)
  • dio29 (PASS)
  • dio30 (PASS)
  • filecaps (PASS)
  • fs_perms01 (PASS)
  • fs_perms02 (PASS)
  • fs_perms03 (PASS)
    aarch64 newly passing:
  • af_alg04 (FAIL -> PASS)
  • mmap16 (FAIL -> PASS)
  • starvation (FAIL -> PASS)

🤖 This PR was automatically generated by GitHub Actions
Run ID: 28090740485

@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Jun 24, 2026
jira VULN-178538
cve CVE-2026-23243
commit-author YunJe Shin <yjshin0438@gmail.com>
commit 5551b02
upstream-diff |
	cast second param `hdr_size(file) + hdr_len` in `check_sub_overflow`
	call to size_t to match the type of the first param `count` to fix
	build issue.

ib_umad_write computes data_len from user-controlled count and the
MAD header sizes. With a mismatched user MAD header size and RMPP
header length, data_len can become negative and reach ib_create_send_mad().
This can make the padding calculation exceed the segment size and trigger
an out-of-bounds memset in alloc_send_rmpp_list().

Add an explicit check to reject negative data_len before creating the
send buffer.

KASAN splat:
[  211.363464] BUG: KASAN: slab-out-of-bounds in ib_create_send_mad+0xa01/0x11b0
[  211.364077] Write of size 220 at addr ffff88800c3fa1f8 by task spray_thread/102
[  211.365867] ib_create_send_mad+0xa01/0x11b0
[  211.365887] ib_umad_write+0x853/0x1c80

Fixes: 2be8e3e ("IB/umad: Add P_Key index support")
	Signed-off-by: YunJe Shin <ioerts@kookmin.ac.kr>
Link: https://patch.msgid.link/20260203100628.1215408-1-ioerts@kookmin.ac.kr
	Signed-off-by: Leon Romanovsky <leon@kernel.org>
(cherry picked from commit 5551b02)
	Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
@bmastbergen bmastbergen force-pushed the {ciq_kernel_automation}_ciqlts8_6 branch from a543a70 to 7c028cf Compare June 24, 2026 19:47
@github-actions

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28125756506

@github-actions

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit 7c028cfd860c (RDMA/umad: Reject negative data_len in ib_umad_write) → upstream 5551b02fdbfd
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -575,7 +575,7 @@
 	}
 
 	base_version = ((struct ib_mad_hdr *)&packet->mad.data)->base_version;
-	if (check_sub_overflow(count, (size_t)(hdr_size(file) + hdr_len), &data_len)) {
+	if (check_sub_overflow(count, hdr_size(file) + hdr_len, &data_len)) {
 		ret = -EINVAL;
 		goto err_ah;
 	}

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -497,5 +498,4 @@
 	struct ib_ah *ah;
-	struct ib_rmpp_mad *rmpp_mad;
 	__be64 *tid;
 	int ret, data_len, hdr_len, copy_offset, rmpp_active;
 	u8 base_version;

This is an automated interdiff check for backported commits.

@github-actions

Copy link
Copy Markdown

Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28125756506

@PlaidCat PlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Same comment as here
#1373 (review)

@PlaidCat PlaidCat requested a review from a team June 24, 2026 19:59

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@roxanan1996 roxanan1996 merged commit 5201953 into ciqlts8_6 Jun 25, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

3 participants